{% extends "base.html" %}

{% block content %}
    <ul class="breadcrumb">
        <li>
            <a href="/monitor/service/{{ cluster.service.id }}">{{ cluster.service.name }}</a> <span
                class="divider">/</span>
        </li>
        <li class="active">{{ cluster.name }}</li>
    </ul>
    <h2> All Tasks. </h2>
    <table class="table table-striped table-bordered">
        <thead>
        <tr>
            <th>job</th>
            <th>task id</th>
            <th>task entry</th>
            <th>last success</th>
            <th>supervisor</th>
        </tr>
        </thead>
        <tbody>
        {% for task in tasks %}
            <tr>
                <td><a href="/monitor/job/{{ task.job.id }}">{{ task.job.name }}</a></td>
                <td><a href="/monitor/task/{{ task.id }}">{{ task.task_id }}</a></td>
                <td><a href="http://{{ task.host }}:{{ task.port }}/">{{ task.host }}:{{ task.port }}</a></td>
                <td>{{ task.last_success_time }}
                    {% if task.health %}
                        <img src="{{ STATIC_URL }}/ok.png" width="24" alt="Big Boat"/>
                    {% else %}
                        <img src="{{ STATIC_URL }}/alert.png" width="24" alt="Big Boat"/>
                    {% endif %}
                </td>
                <td><a href="http://{{ task.host }}:{{supervisor_port}}/">{{ task.host }}:{{supervisor_port}}</a></td>

            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}
